package com.hjc.answer.tools;

import com.google.gson.Gson;

/**
 * Created by IntelliJ IDEA.
 * User: HJC
 * Date: 2019/11/16
 * Time: 15:18
 * To change this template use File | Settings | File Templates.
 */
public class GsonTools {
    private static Gson gson = new Gson();

    private static GsonTools gsonTools;
    private GsonTools(){}
    public static synchronized GsonTools getGsonTools(){
        if(gsonTools == null){
            gsonTools = new GsonTools();
        }
        return gsonTools;
    }
    public String tojsons(Object object){
        String toObjectJson = gson.toJson(object);
        return toObjectJson;
    }
}
